package net.qiqbframework.eventhandling.gateway;


import net.qiqbframework.eventhandling.EventBus;
import net.qiqbframework.eventhandling.EventMessage;
import net.qiqbframework.messaging.intercepting.MessageDispatchInterceptor;

import javax.annotation.Nonnull;
import java.util.List;


public class DefaultEventGateway extends AbstractEventGateway  {


    protected DefaultEventGateway(Builder builder) {
        super(builder);
    }

    public static Builder builder() {
        return new Builder();
    }




    public static class Builder extends AbstractEventGateway.Builder {

        @Override
        public Builder eventBus(@Nonnull EventBus eventBus) {
            super.eventBus(eventBus);
            return this;
        }

        @Override
        public Builder dispatchInterceptors(
                MessageDispatchInterceptor<? super EventMessage<?>>... dispatchInterceptors) {
            super.dispatchInterceptors(dispatchInterceptors);
            return this;
        }

        @Override
        public Builder dispatchInterceptors(
                List<MessageDispatchInterceptor<? super EventMessage<?>>> dispatchInterceptors) {
            super.dispatchInterceptors(dispatchInterceptors);
            return this;
        }

        public DefaultEventGateway build() {
            return new DefaultEventGateway(this);
        }
    }
}
